#!/bin/sh
set +x
osuser=$1
datadir=$2

if [ -z "$osuser" ]; then
   echo "missing oracle os user" 
   exit 1
fi

datadir=$datadir"*"

if [ -z "$datadir" ]; then
   echo "missing backup image directory"
   exit 1
fi

grp=`id -gn $osuser`
if [ -z "$grp" ]; then
   echo "unable to get group for $osuser"
   exit 1
fi

/bin/chown -R "$osuser":"$grp" $datadir
/bin/chmod -R 755 $datadir

exit 0
